﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using ProdService;
using ViewModels.Components;
using ViewModels.User;

namespace UI.ViewComponents
{
    public class ChangeUserName : ViewComponent
    {
        private UserService userService;
        public ChangeUserName(UserService userService)
        {
            this.userService = userService;
        }

        public IViewComponentResult Invoke(int id)
        {
            INameModel model = userService.GetNames(id);
            return View(nameof(ChangeUserName).Prefix(), model);
        }
    }
}
